using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Printing;

namespace dender.dvdcover.core
{
    /// <summary>
    /// Represents a cover 
    /// </summary>
    public class Cover : CoverBase<CoverPart>
    {
        /// <summary>
        /// Creates a cover from a specific format
        /// </summary>
        /// <param name="format">The specified format</param>
        public Cover(Format format) : base(format)
        {
            this.mFormat = format;
            foreach (KeyValuePair<string,Part> p in format.Parts)
            {
                this.AddPart(new CoverPart(p.Value));
            }
        }

        private Format mFormat;
        /// <summary>
        /// Gets the format of the cover.
        /// </summary>
        public Format Format
        {
            get { return mFormat; }
        }

        /// <summary>
        /// Generates a PrintDocument for the cover
        /// </summary>
        /// <returns>The generates PrintDocument</returns>
        public CoverPrintDocument GeneratePrintDocument()
        {
            return new CoverPrintDocument(this, this.Format.PaperKind);
        }
    }
}
